<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="机构名称" prop="organizationName">
        <el-input
          v-model="queryParams.organizationName"
          placeholder="请输入机构名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="一级内设机构" prop="primaryInternalOrg">
        <el-input
          v-model="queryParams.primaryInternalOrg"
          placeholder="请输入一级内设机构"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="二级内设机构" prop="secondaryInternalOrg">
        <el-input
          v-model="queryParams.secondaryInternalOrg"
          placeholder="请输入二级内设机构"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="姓名" prop="name">
        <el-input
          v-model="queryParams.name"
          placeholder="请输入姓名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="身份证号" prop="idNumber">
        <el-input
          v-model="queryParams.idNumber"
          placeholder="请输入身份证号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="人员分类" prop="personnelCategory">
        <el-input
          v-model="queryParams.personnelCategory"
          placeholder="请输入人员分类"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="编制类型/编制经费形式" prop="staffingTypeOrFunding">
        <el-input
          v-model="queryParams.staffingTypeOrFunding"
          placeholder="请输入编制类型/编制经费形式"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="进入本单位形式" prop="entryForm">
        <el-input
          v-model="queryParams.entryForm"
          placeholder="请输入进入本单位形式"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="进入本单位时间" prop="entryDate">
        <el-input
          v-model="queryParams.entryDate"
          placeholder="请输入进入本单位时间"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="领导职务层次" prop="leadershipPosition">
        <el-input
          v-model="queryParams.leadershipPosition"
          placeholder="请输入领导职务层次"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="领导职务名称" prop="leadershipTitle">
        <el-input
          v-model="queryParams.leadershipTitle"
          placeholder="请输入领导职务名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否高配" prop="highConfig">
        <el-input
          v-model="queryParams.highConfig"
          placeholder="请输入是否高配"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否公务员登记" prop="civilServantRegistration">
        <el-input
          v-model="queryParams.civilServantRegistration"
          placeholder="请输入是否公务员登记"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="任现职时间" prop="currentPositionDate">
        <el-input
          v-model="queryParams.currentPositionDate"
          placeholder="请输入任现职时间"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="出生日期" prop="birthDate">
        <el-input
          v-model="queryParams.birthDate"
          placeholder="请输入出生日期"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="职称" prop="professionalTitle">
        <el-input
          v-model="queryParams.professionalTitle"
          placeholder="请输入职称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="入编时间" prop="enrollmentDate">
        <el-input
          v-model="queryParams.enrollmentDate"
          placeholder="请输入入编时间"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="入编文号" prop="enrollmentNumber">
        <el-input
          v-model="queryParams.enrollmentNumber"
          placeholder="请输入入编文号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="进入来源" prop="entrySource">
        <el-input
          v-model="queryParams.entrySource"
          placeholder="请输入进入来源"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参加工作时间" prop="startWorkingDate">
        <el-input
          v-model="queryParams.startWorkingDate"
          placeholder="请输入参加工作时间"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="民族" prop="ethnicGroup">
        <el-input
          v-model="queryParams.ethnicGroup"
          placeholder="请输入民族"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="籍贯" prop="nativePlace">
        <el-input
          v-model="queryParams.nativePlace"
          placeholder="请输入籍贯"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="核编单编号" prop="staffingNumber">
        <el-input
          v-model="queryParams.staffingNumber"
          placeholder="请输入核编单编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="毕业学校" prop="graduationSchool">
        <el-input
          v-model="queryParams.graduationSchool"
          placeholder="请输入毕业学校"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="毕业时间" prop="graduationDate">
        <el-input
          v-model="queryParams.graduationDate"
          placeholder="请输入毕业时间"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="政治面貌" prop="politicalAffiliation">
        <el-input
          v-model="queryParams.politicalAffiliation"
          placeholder="请输入政治面貌"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="学 历" prop="education">
        <el-input
          v-model="queryParams.education"
          placeholder="请输入学 历"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="学 位" prop="degree">
        <el-input
          v-model="queryParams.degree"
          placeholder="请输入学 位"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="专业" prop="major">
        <el-input
          v-model="queryParams.major"
          placeholder="请输入专业"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="入党(团)时间" prop="partyJoinDate">
        <el-input
          v-model="queryParams.partyJoinDate"
          placeholder="请输入入党(团)时间"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="曾用名" prop="formerName">
        <el-input
          v-model="queryParams.formerName"
          placeholder="请输入曾用名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="工资来源" prop="salarySource">
        <el-input
          v-model="queryParams.salarySource"
          placeholder="请输入工资来源"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="岗位类别" prop="positionCategory">
        <el-input
          v-model="queryParams.positionCategory"
          placeholder="请输入岗位类别"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="公务员职级" prop="civilServantLevel">
        <el-input
          v-model="queryParams.civilServantLevel"
          placeholder="请输入公务员职级"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否超配干部" prop="overstaffedLeader">
        <el-input
          v-model="queryParams.overstaffedLeader"
          placeholder="请输入是否超配干部"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否为中小学周转使用的空编" prop="isTemporary">
        <el-input
          v-model="queryParams.isTemporary"
          placeholder="请输入是否为中小学周转使用的空编"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否单列管理行政编制" prop="isSeparateManagement">
        <el-input
          v-model="queryParams.isSeparateManagement"
          placeholder="请输入是否单列管理行政编制"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否参照公务员法管理" prop="isCivilServantLaw">
        <el-input
          v-model="queryParams.isCivilServantLaw"
          placeholder="请输入是否参照公务员法管理"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否军转编制" prop="isMilitaryConversion">
        <el-input
          v-model="queryParams.isMilitaryConversion"
          placeholder="请输入是否军转编制"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:bumenrenyuanxinxi:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['system:bumenrenyuanxinxi:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:bumenrenyuanxinxi:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['system:bumenrenyuanxinxi:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="bumenrenyuanxinxiList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="机构名称" align="center" prop="organizationName" />
      <el-table-column label="一级内设机构" align="center" prop="primaryInternalOrg" />
      <el-table-column label="二级内设机构" align="center" prop="secondaryInternalOrg" />
      <el-table-column label="姓名" align="center" prop="name" />
      <el-table-column label="性别" align="center" prop="sex" />
      <el-table-column label="身份证号" align="center" prop="idNumber" />
      <el-table-column label="人员分类" align="center" prop="personnelCategory" />
      <el-table-column label="编制类型/编制经费形式" align="center" prop="staffingTypeOrFunding" />
      <el-table-column label="人员状态" align="center" prop="personnelStatus" />
      <el-table-column label="进入本单位形式" align="center" prop="entryForm" />
      <el-table-column label="进入本单位时间" align="center" prop="entryDate" />
      <el-table-column label="领导职务层次" align="center" prop="leadershipPosition" />
      <el-table-column label="领导职务名称" align="center" prop="leadershipTitle" />
      <el-table-column label="是否高配" align="center" prop="highConfig" />
      <el-table-column label="是否公务员登记" align="center" prop="civilServantRegistration" />
      <el-table-column label="任现职时间" align="center" prop="currentPositionDate" />
      <el-table-column label="出生日期" align="center" prop="birthDate" />
      <el-table-column label="职称" align="center" prop="professionalTitle" />
      <el-table-column label="入编时间" align="center" prop="enrollmentDate" />
      <el-table-column label="入编文号" align="center" prop="enrollmentNumber" />
      <el-table-column label="进入来源" align="center" prop="entrySource" />
      <el-table-column label="参加工作时间" align="center" prop="startWorkingDate" />
      <el-table-column label="民族" align="center" prop="ethnicGroup" />
      <el-table-column label="籍贯" align="center" prop="nativePlace" />
      <el-table-column label="核编单编号" align="center" prop="staffingNumber" />
      <el-table-column label="毕业学校" align="center" prop="graduationSchool" />
      <el-table-column label="毕业时间" align="center" prop="graduationDate" />
      <el-table-column label="政治面貌" align="center" prop="politicalAffiliation" />
      <el-table-column label="学 历" align="center" prop="education" />
      <el-table-column label="学 位" align="center" prop="degree" />
      <el-table-column label="专业" align="center" prop="major" />
      <el-table-column label="入党(团)时间" align="center" prop="partyJoinDate" />
      <el-table-column label="备注" align="center" prop="remark" />
      <el-table-column label="曾用名" align="center" prop="formerName" />
      <el-table-column label="工资来源" align="center" prop="salarySource" />
      <el-table-column label="岗位类别" align="center" prop="positionCategory" />
      <el-table-column label="公务员职级" align="center" prop="civilServantLevel" />
      <el-table-column label="是否超配干部" align="center" prop="overstaffedLeader" />
      <el-table-column label="是否为中小学周转使用的空编" align="center" prop="isTemporary" />
      <el-table-column label="是否单列管理行政编制" align="center" prop="isSeparateManagement" />
      <el-table-column label="是否参照公务员法管理" align="center" prop="isCivilServantLaw" />
      <el-table-column label="是否军转编制" align="center" prop="isMilitaryConversion" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:bumenrenyuanxinxi:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:bumenrenyuanxinxi:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改部门人员信息表对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="机构名称" prop="organizationName">
          <el-input v-model="form.organizationName" placeholder="请输入机构名称" />
        </el-form-item>
        <el-form-item label="一级内设机构" prop="primaryInternalOrg">
          <el-input v-model="form.primaryInternalOrg" placeholder="请输入一级内设机构" />
        </el-form-item>
        <el-form-item label="二级内设机构" prop="secondaryInternalOrg">
          <el-input v-model="form.secondaryInternalOrg" placeholder="请输入二级内设机构" />
        </el-form-item>
        <el-form-item label="姓名" prop="name">
          <el-input v-model="form.name" placeholder="请输入姓名" />
        </el-form-item>
        <el-form-item label="身份证号" prop="idNumber">
          <el-input v-model="form.idNumber" placeholder="请输入身份证号" />
        </el-form-item>
        <el-form-item label="人员分类" prop="personnelCategory">
          <el-input v-model="form.personnelCategory" placeholder="请输入人员分类" />
        </el-form-item>
        <el-form-item label="编制类型/编制经费形式" prop="staffingTypeOrFunding">
          <el-input v-model="form.staffingTypeOrFunding" placeholder="请输入编制类型/编制经费形式" />
        </el-form-item>
        <el-form-item label="进入本单位形式" prop="entryForm">
          <el-input v-model="form.entryForm" placeholder="请输入进入本单位形式" />
        </el-form-item>
        <el-form-item label="进入本单位时间" prop="entryDate">
          <el-input v-model="form.entryDate" placeholder="请输入进入本单位时间" />
        </el-form-item>
        <el-form-item label="领导职务层次" prop="leadershipPosition">
          <el-input v-model="form.leadershipPosition" placeholder="请输入领导职务层次" />
        </el-form-item>
        <el-form-item label="领导职务名称" prop="leadershipTitle">
          <el-input v-model="form.leadershipTitle" placeholder="请输入领导职务名称" />
        </el-form-item>
        <el-form-item label="是否高配" prop="highConfig">
          <el-input v-model="form.highConfig" placeholder="请输入是否高配" />
        </el-form-item>
        <el-form-item label="是否公务员登记" prop="civilServantRegistration">
          <el-input v-model="form.civilServantRegistration" placeholder="请输入是否公务员登记" />
        </el-form-item>
        <el-form-item label="任现职时间" prop="currentPositionDate">
          <el-input v-model="form.currentPositionDate" placeholder="请输入任现职时间" />
        </el-form-item>
        <el-form-item label="出生日期" prop="birthDate">
          <el-input v-model="form.birthDate" placeholder="请输入出生日期" />
        </el-form-item>
        <el-form-item label="职称" prop="professionalTitle">
          <el-input v-model="form.professionalTitle" placeholder="请输入职称" />
        </el-form-item>
        <el-form-item label="入编时间" prop="enrollmentDate">
          <el-input v-model="form.enrollmentDate" placeholder="请输入入编时间" />
        </el-form-item>
        <el-form-item label="入编文号" prop="enrollmentNumber">
          <el-input v-model="form.enrollmentNumber" placeholder="请输入入编文号" />
        </el-form-item>
        <el-form-item label="进入来源" prop="entrySource">
          <el-input v-model="form.entrySource" placeholder="请输入进入来源" />
        </el-form-item>
        <el-form-item label="参加工作时间" prop="startWorkingDate">
          <el-input v-model="form.startWorkingDate" placeholder="请输入参加工作时间" />
        </el-form-item>
        <el-form-item label="民族" prop="ethnicGroup">
          <el-input v-model="form.ethnicGroup" placeholder="请输入民族" />
        </el-form-item>
        <el-form-item label="籍贯" prop="nativePlace">
          <el-input v-model="form.nativePlace" placeholder="请输入籍贯" />
        </el-form-item>
        <el-form-item label="核编单编号" prop="staffingNumber">
          <el-input v-model="form.staffingNumber" placeholder="请输入核编单编号" />
        </el-form-item>
        <el-form-item label="毕业学校" prop="graduationSchool">
          <el-input v-model="form.graduationSchool" placeholder="请输入毕业学校" />
        </el-form-item>
        <el-form-item label="毕业时间" prop="graduationDate">
          <el-input v-model="form.graduationDate" placeholder="请输入毕业时间" />
        </el-form-item>
        <el-form-item label="政治面貌" prop="politicalAffiliation">
          <el-input v-model="form.politicalAffiliation" placeholder="请输入政治面貌" />
        </el-form-item>
        <el-form-item label="学 历" prop="education">
          <el-input v-model="form.education" placeholder="请输入学 历" />
        </el-form-item>
        <el-form-item label="学 位" prop="degree">
          <el-input v-model="form.degree" placeholder="请输入学 位" />
        </el-form-item>
        <el-form-item label="专业" prop="major">
          <el-input v-model="form.major" placeholder="请输入专业" />
        </el-form-item>
        <el-form-item label="入党(团)时间" prop="partyJoinDate">
          <el-input v-model="form.partyJoinDate" placeholder="请输入入党(团)时间" />
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" placeholder="请输入备注" />
        </el-form-item>
        <el-form-item label="曾用名" prop="formerName">
          <el-input v-model="form.formerName" placeholder="请输入曾用名" />
        </el-form-item>
        <el-form-item label="工资来源" prop="salarySource">
          <el-input v-model="form.salarySource" placeholder="请输入工资来源" />
        </el-form-item>
        <el-form-item label="岗位类别" prop="positionCategory">
          <el-input v-model="form.positionCategory" placeholder="请输入岗位类别" />
        </el-form-item>
        <el-form-item label="公务员职级" prop="civilServantLevel">
          <el-input v-model="form.civilServantLevel" placeholder="请输入公务员职级" />
        </el-form-item>
        <el-form-item label="是否超配干部" prop="overstaffedLeader">
          <el-input v-model="form.overstaffedLeader" placeholder="请输入是否超配干部" />
        </el-form-item>
        <el-form-item label="是否为中小学周转使用的空编" prop="isTemporary">
          <el-input v-model="form.isTemporary" placeholder="请输入是否为中小学周转使用的空编" />
        </el-form-item>
        <el-form-item label="是否单列管理行政编制" prop="isSeparateManagement">
          <el-input v-model="form.isSeparateManagement" placeholder="请输入是否单列管理行政编制" />
        </el-form-item>
        <el-form-item label="是否参照公务员法管理" prop="isCivilServantLaw">
          <el-input v-model="form.isCivilServantLaw" placeholder="请输入是否参照公务员法管理" />
        </el-form-item>
        <el-form-item label="是否军转编制" prop="isMilitaryConversion">
          <el-input v-model="form.isMilitaryConversion" placeholder="请输入是否军转编制" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listBumenrenyuanxinxi, getBumenrenyuanxinxi, delBumenrenyuanxinxi, addBumenrenyuanxinxi, updateBumenrenyuanxinxi } from "@/api/system/bumenrenyuanxinxi";

export default {
  name: "Bumenrenyuanxinxi",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 部门人员信息表表格数据
      bumenrenyuanxinxiList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        organizationName: null,
        primaryInternalOrg: null,
        secondaryInternalOrg: null,
        name: null,
        sex: null,
        idNumber: null,
        personnelCategory: null,
        staffingTypeOrFunding: null,
        personnelStatus: null,
        entryForm: null,
        entryDate: null,
        leadershipPosition: null,
        leadershipTitle: null,
        highConfig: null,
        civilServantRegistration: null,
        currentPositionDate: null,
        birthDate: null,
        professionalTitle: null,
        enrollmentDate: null,
        enrollmentNumber: null,
        entrySource: null,
        startWorkingDate: null,
        ethnicGroup: null,
        nativePlace: null,
        staffingNumber: null,
        graduationSchool: null,
        graduationDate: null,
        politicalAffiliation: null,
        education: null,
        degree: null,
        major: null,
        partyJoinDate: null,
        formerName: null,
        salarySource: null,
        positionCategory: null,
        civilServantLevel: null,
        overstaffedLeader: null,
        isTemporary: null,
        isSeparateManagement: null,
        isCivilServantLaw: null,
        isMilitaryConversion: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询部门人员信息表列表 */
    getList() {
      this.loading = true;
      listBumenrenyuanxinxi(this.queryParams).then(response => {
        this.bumenrenyuanxinxiList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        organizationName: null,
        primaryInternalOrg: null,
        secondaryInternalOrg: null,
        name: null,
        sex: null,
        idNumber: null,
        personnelCategory: null,
        staffingTypeOrFunding: null,
        personnelStatus: null,
        entryForm: null,
        entryDate: null,
        leadershipPosition: null,
        leadershipTitle: null,
        highConfig: null,
        civilServantRegistration: null,
        currentPositionDate: null,
        birthDate: null,
        professionalTitle: null,
        enrollmentDate: null,
        enrollmentNumber: null,
        entrySource: null,
        startWorkingDate: null,
        ethnicGroup: null,
        nativePlace: null,
        staffingNumber: null,
        graduationSchool: null,
        graduationDate: null,
        politicalAffiliation: null,
        education: null,
        degree: null,
        major: null,
        partyJoinDate: null,
        remark: null,
        formerName: null,
        salarySource: null,
        positionCategory: null,
        civilServantLevel: null,
        overstaffedLeader: null,
        isTemporary: null,
        isSeparateManagement: null,
        isCivilServantLaw: null,
        isMilitaryConversion: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.organizationName)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加部门人员信息表";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const organizationName = row.organizationName || this.ids
      getBumenrenyuanxinxi(organizationName).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改部门人员信息表";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.organizationName != null) {
            updateBumenrenyuanxinxi(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addBumenrenyuanxinxi(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const organizationNames = row.organizationName || this.ids;
      this.$modal.confirm('是否确认删除部门人员信息表编号为"' + organizationNames + '"的数据项？').then(function() {
        return delBumenrenyuanxinxi(organizationNames);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('system/bumenrenyuanxinxi/export', {
        ...this.queryParams
      }, `bumenrenyuanxinxi_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
